$(function () { // 页面加载
    // 删除按钮
    $('.btn-delete').click(function () {
        let url = $(this).data('url');

        Swal.fire({
            title: '请确认是否删除',
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#92b577',
            confirmButtonText: '确认',
            cancelButtonText: '取消'
        }).then((result) => {
            if (result.value) { // 判断是否有值；打断点可以看到它是通过 value 传值
                window.location.href = url;
            }
        })
    });
});